#set(title='下单结算')
#@index_layout()
#define index_main()
<div class="row text-center">
	<h2>下单结算</h2>
</div>
#set(total = 0)
<form>
	<div class="panel panel-default">
			<div class="panel-heading">
				<h3 class="panel-title">
					用户信息
				</h3>
			</div>
			<div class="panel-body">
				<div class="form-group">
					<label>收货人姓名</label> <input type="text" name="name" value="#(user.name)"
						class="form-control" placeholder="请输入姓名" required>
				</div>
				<div class="form-group">
					<label>手机号码</label> <input type="text" name="mobile" value="#(user.mobile)"
						class="form-control" placeholder="请输入手机号码" required>
				</div>
				<div class="form-group">
					<label>收货地址</label> <input type="text" name="address" value="#(user.address)"
						class="form-control" placeholder="请输入详细地址(包括省、市、镇、街道、小区等 )" required>
				</div>
			</div>
		</div>
		<div class="panel panel-default">
			<div class="panel-heading">
				<h3 class="panel-title">
					支付方式
				</h3>
			</div>
			<div class="panel-body">
				<div class="radio">
				    <label>
				      <input type="radio" checked="checked" name="payway" value="online"> 在线支付
				    </label>
				    <!-- -->
				    <label>
				      <input type="radio" name="payway" value="offline"> 货到付款
				    </label> 
				  </div>
				  <div class="checkbox">
				    <label>
				      <input type="checkbox" name="invoice" value="yes"> 需要发票
				    </label>
				  </div>
			</div>
		</div>
		
 <div class="table-responsive">
        <table class="table table-striped ">
          <thead>
            <tr>
              <th>图书信息</th>
              <th>单价（元）</th>
              <th>数量</th>
              <th>金额（元）</th>
            </tr>
          </thead>
          <tbody>
          #for(x : list)
          		#set(total = total + x.total)
          		<tr>
	              <td><a href="#(ctx)/book/detail/#(x.bookId)"><img src="#(uploadPah)#(x.book.bookImg)" alt="book image" width="70px"></a>
	              	<a href="#(ctx)/book/detail/#(x.bookId)">#(x.book.name)
	              	</a>
	              </td>
	              <td>¥#(x.price)</td>
	              <td>#(x.num)</td>
	              <td>¥#(x.total)</td>
	              </td>
	            </tr>
          #end
          </tbody>
        </table>
        
        <div class="text-right">
        	<div>
				<h2 class="text-danger">订单金额：¥#(total)</h2>
				<a type="button" class="btn btn-default" href="#(ctx)/cart">返回购物车</a>
				<button class="btn btn-success" type="button" id="subOrderBtn">提交订单</button>
			</div>
        </div>
      </div>
      </form>
#end
